/*
 * p3229.cpp
 *
 *  Created on: 2013-8-1
 *      Author: zy
 */
#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<set>
#include<stack>
#include<queue>
#include<algorithm>
using namespace std;
const int INF = 1e9;
int n, m, k,day;
double dp[16][1 << 16], a[16], map[16][16];
void floyd()
{
	for (int k = 0; k < n; k++)
	{
		for (int i = 0; i < n; i++)
			for (int j = 0; j < n; j++)
			{
				if (i != k && i != j && j != k)
					map[i][j] = min(map[i][j], map[i][k] + map[k][j]);
			}
	}
}
void init()
{
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < (1 << n); j++)
		{
			dp[i][j] = INF;
		}
		for (int j = 0; j < n; j++)
		{
			map[i][j] = INF;
		}
		map[i][i] = 0;
	}
}
int main()
{
	while (scanf("%d%d%d", &n, &m, &day), (n || m || day))
	{
		day *= 12;
		int must = 0, ans = -1;
		init();
		for (int i = 1; i <= m; i++)
		{
			int x;
			scanf("%d", &x);
			must += 1 << (x - 1);
		}
		for (int i = 0; i < n; i++)
			scanf("%lf", &a[i]);
		int u, v, len, kind;
		while (scanf("%d%d%d%d", &u, &v, &len, &kind) && u)
		{
			u--;
			v--;
			double hour = len * 1.0 / (kind ? 120.0 : 80.0);
			if (map[u][v] > hour)
				map[u][v] = hour, map[v][u] = hour;
		}
		floyd();
		ans = -1;
		dp[0][0] = 0;
		for (int i = 1; i < n; i++)
			dp[i][1 << i] = map[0][i] + a[i];
		for (int j = 0; j < (1 << n); j++)
		{
			for (int i = 0; i < n; i++)
			{
				if (j & (1 << i) && j != (1 << i))
				{
					for (int k = 0; k < n; k++)
					{
						if (j & (1 << k) && i != k && j != (1 << k))
							dp[i][j] = min(dp[i][j], dp[k][j - (1 << i)]
									+ map[k][i] + a[i]);
					}
					if (((j & must) == must) && dp[i][j] + map[i][0] <= day)
					{
						int tem = j;
						int cnt = 0;
						while (tem)
						{
							cnt += tem % 2;
							tem >>= 1;
						}
						ans = max(ans, cnt);
					}
				}
			}
		}
		if (ans >= 0)
			cout << ans << endl;
		else
			cout << "No Solution" << endl;
	}
	return 0;
}
